﻿//
//  Log.cs
//  Marquee Moment
//
//  Copyright 2011 Systematix Technocrates. All rights reserved.
//
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.IO;
using System.Globalization;
using System.Windows.Forms;

namespace MarqueeMoment.Entities
{
  public static class Log
  {
        public static void LogFile(string str)
      {
            string ts = "File";
            string appdata_folder = Application.StartupPath.ToString();

            StreamWriter logfile = File.AppendText(String.Format(@"{0}\Log_{1}.log", appdata_folder, ts));
            //StreamWriter logfile = File.AppendText(String.Format(@"\Sample_Log_{1}.log", appdata_folder, ts));

            string dt = DateTime.Now.ToString("yyyy/MM/dd-HH:mm:ss--", CultureInfo.InvariantCulture);
            logfile.WriteLine(dt);
            logfile.WriteLine(str);
           
            logfile.Flush();
            logfile.Close(); 
    }
  }
}
